.PHONY: test all clean ast mrproper

all:
	ocamlbuild -libs str -use-menhir -menhir "menhir -v" main.byte
	rm main.byte
	mv _build/main.byte jlangc

lexbuild:
	ocamlbuild -libs str -use-menhir -menhir "menhir -v" lexer_debug.byte
	rm lexer_debug.byte
	mv _build/parsing/lexer_debug.byte jlang-lexer

dev: all
	#./jlangc -o jquery-jlang.js test.js
	./jlangc -o myOutput.js pre.js
	
tests: all
	find ./tests/*/* -exec ./jlangc -print '{}' \; | grep "alert"
	
lex: lexbuild
	./jlangc-lexer pre.js
	
ast: all
	./jlangc -print-jlang-ast pre.js

mrproper: clean

clean:
	ocamlbuild -clean

